﻿using Mathmall.Administration.common;
using Mathmall.Administration.Models;
using Mathmall.Administration.Vo;
using Microsoft.AspNetCore.Identity;

namespace Mathmall.Administration.Service
{
    public interface IUserService
    {
        /// <summary>
        /// 给用户添加角色
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="roleNames"></param>
        /// <returns></returns>
        Task<IdentityResult> DistributeRole(int userId, List<string> roleNames);

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="loginVo"></param>
        /// <returns></returns>
        Task<UserVo?> UserLogin(LoginVo loginVo);

        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="userVo">用户</param>
        /// <returns></returns>
        Task<IdentityResult> AddUser(UserVo userVo);

        /// <summary>
        /// 分页查询用户信息
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="condition"></param>
        /// <returns></returns>
        Task<PaginatedList<UserVo>> PaginatedQuery(int pageIndex, int pageSize, string condition);

        /// <summary>
        /// 根据用户id集合批量删除用户
        /// </summary>
        /// <param name="userIds"></param>
        /// <returns></returns>
        Task<int> DeleteUsersByUserIds(List<int> userIds);
    }
}